import { createRouter, createWebHashHistory } from 'vue-router'
import LayoutView from '@/views/LayoutView.vue'

const routes = [
    {
        path: "/",
        name: "layout",
        component: LayoutView,
        redirect: { name: "ceping_x" },
        children: [
            {
                path: "ceping_x",
                name: "ceping_x",
                component: () => import("@/views/shouye/ceping/CePing.vue"),
                meta: { index: "1-1", name: ['首页', '心理测评'] }
            },
            {
                path: "dayi_x",
                name: "dayi_x",
                component: () => import("@/views/shouye/dayi/DaYi.vue"),
                meta: { index: "1-2", name: ['首页', '心理答疑'] }
            },
            {
                path: "zhishi_x",
                name: "zhishi_x",
                component: () => import("@/views/shouye/zhishi/ZhiShi.vue"),
                meta: { index: "1-3", name: ['首页', '心理知识'] }
            },
            {
                path: "fm_x",
                name: "fm_x",
                component: () => import("@/views/shouye/fm/FM.vue"),
                meta: { index: "1-4", name: ['首页', 'FM'] }
            },
            {
                path: "gongyi_x",
                name: "gongyi_x",
                component: () => import("@/views/shouye/gongyi/GongYi.vue"),
                meta: { index: "1-5", name: ['首页', '公益中心'] }
            },
            {
                path: "jingxuan_x",
                name: "jingxuan_x",
                component: () => import("@/views/shouye/wenzhang/WenZhang.vue"),
                meta: { index: "1-6", name: ['首页', '精选文章'] }
            },
            {
                path: "zixun_l",
                name: "zixun_l",
                component: () => import("@/views/zixun/zixunshi/ZiXunShi.vue"),
                meta: { index: "2-1", name: ['咨询师', '咨询师管理'] }
            },
            {
                path: "yuyue_l",
                name: "yuyue_l",
                component: () => import("@/views/zixun/zixunshi/YuYue.vue"),
                meta: { index: "2-2", name: ['咨询师', '预约管理'] }
            },
            {
                path: "lunbo_d",
                name: "lunbo_d",
                component: () => import("@/views//kecheng/lunbo/LunBo.vue"),
                meta: { index: "3-1", name: ['轮播图'] }
            },
            {
                path: "shizi_d",
                name: "shizi_d",
                component: () => import("@/views/kecheng/shizi/ShiZi.vue"),
                meta: { index: "3-2", name: ['师资团队'] }
            },
            {
                path: "kecheng_d",
                name: "kecheng_d",
                component: () => import("@/views/kecheng/kecheng/KeCheng.vue"),
                meta: { index: "3-3", name: ['课程管理'] }
            },
            {
                path: "yonghu_c",
                name: "yonghu_c",
                component: () => import("@/views/wode/yonghu/YongHu.vue"),
                meta: { index: "4-1", name: ['我的', '用户管理'] }
            },
            {
                path: "gonggao_c",
                name: "gonggao_c",
                component: () => import("@/views/wode/gonggao/GongGao.vue"),
                meta: { index: "4-2", name: ["我的", '咨询公告'] }
            }
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(process.env.BASE_URL),
    routes
})

export default router
